import request from '@/utils/request'

// 采购入库单列表查询
export function listReceipts(query) {
  return request({
    url: '/purchase/receipts/list',
    method: 'get',
    params: query
  })
}

// 查询采购入库单详情
export function getReceipts(inboundNo) {
  return request({
    url: `/purchase/receipts/get/${inboundNo}`,
    method: 'get'
  })
}


// 采购入库单详情
export function updateViewReceipts(inboundNo) {
  return request({
    url: `/purchase/receipts/updateView/${inboundNo}`,
    method: 'get',
  })
}
// 修改采购入库单
export function updateReceipts(data) {
  return request({
    url: `/purchase/receipts/update`,
    method: 'put',
    data
  })
}

// 删除采购入库单
export function deleteReceipts(inboundNo) {
  return request({
    url: `/purchase/receipts/delete/${inboundNo}`,
    method: 'delete',
    params: { inboundNo }
  })
}

// 提交采购入库单（状态改为待审核）
export function submitReceipts(inboundNo) {
  return request({
    url: `/purchase/receipts/submit/${inboundNo}`,
    method: 'put',
    params: { inboundNo }
  })
}

// 获取操作记录
export function getReceiptsOperationRecords(inboundNo) {
  return request({
    url: `/purchase/receipts/operationRecords/${inboundNo}`,
    method: 'get',
    params: { inboundNo }
  })
}
